import request from '../network/request'

// 获取用户权限列表
export function getUserRole() {
  return new Promise((resolve) => {
    request.get('/user/role/list').then((r) => {
      const req = {
        list: [],
        obj: {}
      }
      req.list = r.data.data
      req.list.forEach(t => {
        req.obj[t._id] = t.roleName
      })
      resolve(req)
    })
  })
}
